package cn.edu.baiyunu.myapplication.data.db.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import cn.edu.baiyunu.myapplication.data.db.entity.UserPreference
import kotlinx.coroutines.flow.Flow

@Dao
interface UserPreferenceDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insert(userPreference: UserPreference)
    
    @Update
    suspend fun update(userPreference: UserPreference)
    
    @Query("SELECT * FROM user_preferences WHERE id = 'user_preference' LIMIT 1")
    fun getUserPreference(): Flow<UserPreference?>
} 